$(function(){
	$.ajaxPrefilter(function(x,y,z){
		x.url = "http://120.78.90.235/tbk" + y.url;
		x.type = y.type || "POST";
		if(!y.dataType)x.dataTypes[0]="json";
		z.setRequestHeader("Authorization",plus.storage.getItem('token'));
		x.dataFilter = function(data,type){
			if(x.dataTypes.length == 1 && x.dataTypes.indexOf("json") != -1){
				console.log("~★☆：            "+y.url+"                                                                                                     ")
				console.log("~★☆："+JSON.stringify(data))
			}else{
				console.log("~★☆：             "+y.url+"                                                                                                     ")
				console.log("~★☆："+data)
			}
			return data;
		}
		if(!x.error){
			x.error = function(m,u,n){
				if(u=="parsererror")var E = "解析错误";
				if(u=="timeout")var E = "超时";
				if(u=="error")var E = "错误";
				if(u=="abort")var E = "中止";
				console.log("                                                                                                     ")
				console.log("~★☆：ERROR~✖✖✖This Url     >>>>          "+y.url+"              ~✖✖✖✖✖✖✖✖~")
				console.log("~★☆：ERROR~✖✖✖Reason     >>>>          "+JSON.stringify(u)+"~★☆"+E+"！"+"                                                                                                                       ")
			}
		}
	})
})
